class Chain(object):

    def __init__(self, path=''):
        self._path = path

    def __getattr__(self, path):
        return Chain('%s/%s' % (self._path, path))

    def __str__(self):
        return self._path

    # def user(self,username):
    #     return Chain('%s/%s' % (self._path, username))

    #支持函数调用
    def __call__(self, param):
        return Chain('%s/%s' %(self._path, str(param)))

    __repr__ = __str__

print(Chain().user("joe").blog.list.new('news').age(88))
print(Chain().users('michael').age(23).sex('female').repos)